// AC
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MAX_H = 3005;     // 最大高度
const int MAX_W = 3005;     // 最大宽度
int dist[MAX_H][MAX_W];     // 存储每个点到最近初始点的距离
bool visited[MAX_H][MAX_W]; // 标记是否已访问
// 方向数组：上、右、下、左
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, 1, 0, -1};
const int INF = 1001001001; // 表示无穷大的值
int main() {

  int h, w, k; // 网格高度、宽度和初始点数
  cin >> h >> w >> k;
  queue<P> Q; // BFS队列
  for (int i = 1; i <= k; i++) {
    int x, y;
    cin >> x >> y;
    Q.push({x, y});
    dist[x][y] = 0; // 初始点距离为0
    visited[x][y] = true;
  }

  while (!Q.empty()) {
    int x, y;
    tie(x, y) = Q.front();
    Q.pop();
    for (int d = 0; d < 4; d++) {
      int nx = x + di[d];
      int ny = y + dj[d];
      if (nx < 1 || nx > h || ny < 1 || ny > w)
        continue;
      if (!visited[nx][ny]) {
        dist[nx][ny] = dist[x][y] + 1;
        Q.push({nx, ny});
        visited[nx][ny] = true;
      }
    }
  }

  int sum = 0;
  for (int i = 1; i <= h; i++) {
    for (int j = 1; j <= w; j++) {
      sum += dist[i][j];
    }
  }
  cout << sum;
  return 0;
}